<?php

namespace app\mini\validate;

use think\Validate;

class CustomerPoint  extends Validate
{
    /**

     * 验证规则

     * @var string[]

     */

    protected $rule = [

        'customer_id'   => 'require|number|gt:0',

        'point_goods_id'                  => 'require|number|gt:0',

//        'name'                  => 'require|is_goods_unique:coupon|max:50|min:1'

    ];



    /**

     * 错误信息

     * @var string[]

     */

    protected $message = [

        'customer_id.require'   => '客户id未填',

        'customer_id.number'    => '客户id必须为纯数字',

        'customer_id.gt'        => '客户id错误',

        'point_goods_id.require'   => '积分商品id错误',

        'point_goods_id.number'    => '积分商品id必须为纯数字',

        'point_goods_id.gt'        => '积分商品id错误',

//        'type.require'                  => '优惠券类型必须选择',
//
//        'name.require'                  => '优惠券名称必须填写',
//
//        'name.is_goods_unique'          => '优惠券名称已存在',
//
//        'name.max'                      => '优惠券名称最多填写50个字符',
//
//        'name.min'                      => '请填写优惠券名称'

    ];





    /**

     * 场景

     * @var \string[][]

     */

    protected $scene = [
        'buy'=>['customer_id','point_goods_id'],
        'list'=>['customer_id']
    ];
}
